<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<!-- Set render engine for 360 browser -->
	<meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

	<link href="/statics/simpleboot/themes/<?php echo C('SP_ADMIN_STYLE');?>/theme.min.css" rel="stylesheet">
    <link href="/statics/simpleboot/css/simplebootadmin.css" rel="stylesheet">
    <link href="/statics/js/artDialog/skins/default.css" rel="stylesheet" />
    <link href="/statics/simpleboot/font-awesome/4.2.0/css/font-awesome.min.css"  rel="stylesheet" type="text/css">
    <style>
		.length_3{width: 180px;}
		form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
		.table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;}
		.table-list{margin-bottom: 0px;}
	</style>
	<!--[if IE 7]>
	<link rel="stylesheet" href="/statics/simpleboot/font-awesome/4.2.0/css/font-awesome-ie7.min.css">
	<![endif]-->
<script type="text/javascript">
//全局变量
var GV = {
    DIMAUB: "/",
    JS_ROOT: "statics/js/",
    TOKEN: ""
};
</script>
<!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="/statics/js/jquery.js"></script>
    <script src="/statics/js/wind.js"></script>
    <script src="/statics/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<?php if(APP_DEBUG): ?><style>
		#think_page_trace_open{
			z-index:9999;
		}
	</style><?php endif; ?>
<style type="text/css">
.col-auto { overflow: auto; _zoom: 1;_float: left;}
.col-right { float: right; width: 210px; overflow: hidden; margin-left: 6px; }
.table th, .table td {vertical-align: middle;}
.picList li{margin-bottom: 5px;}
</style>
</head>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
  <ul class="nav nav-tabs">
     <li><a href="<?php echo U('AdminPost/index');?>">景区列表</a></li>
     <li class="active"><a href="#">票价销售</a></li>
  </ul>
  <!-- <div class="col-right">
    <div class="table_full">
      <table class="table table-bordered">
         <tr>
          <td><b>缩略图</b></td>
        </tr>
        <tr>
          <td>
          	<div  style="text-align: center;"><input type='hidden' name='smeta[thumb]' id='thumb' value="<?php echo ((isset($smeta["thumb"]) && ($smeta["thumb"] !== ""))?($smeta["thumb"]):''); ?>">
			<a href='javascript:void(0);' onclick="flashupload('thumb_images', '附件上传','thumb',thumb_images,'1,jpg|jpeg|gif|png|bmp,1,,,1','','','');return false;">
			
			<?php if(empty($smeta['thumb'])): ?><img src="/statics/images/icon/upload-pic.png" id='thumb_preview' width='135' height='113' style='cursor:hand' />
			<?php else: ?>
				<img src="<?php echo sp_get_asset_upload_path($smeta['thumb']);?>" id='thumb_preview' width='135' height='113' style='cursor:hand' /><?php endif; ?>
			
			</a>
			
            <input type="button"  class="btn" onclick="$('#thumb_preview').attr('src','/statics/images/icon/upload-pic.png');$('#thumb').val('');return false;" value="取消图片">
            </div>
			</td>
        </tr>
        <tr>
          <td><b>发布时间</b></td>
        </tr>
        <tr>
          <td><input type="text" name="post[post_modified]" id="updatetime" value="<?php echo ($post["post_modified"]); ?>" size="21" class="input-small J_datetime" style="width:160px;"></td>
        </tr>
        <tr>
          <td><b>评论</b></td>
        </tr>
        <tr>
          <td>
          	<label class="ib" style="width:88px"><a href="javascript:open_iframe_dialog('<?php echo u('comment/commentadmin/index',array('post_id'=>$post['id']));?>','评论列表')">查看评论</a></label>
          </td>
        </tr>
        <tr>
          <td><b>状态</b></td>
        </tr>
        <tr>
          <td>
          	<span class="switch_list cc">
              <?php $status_yes=$post['post_status']==1?"checked":""; $status_no=$post['post_status']==0?"checked":""; $istop_yes=$post['istop']==1?"checked":""; $istop_no=$post['istop']==0?"checked":""; $recommended_yes=$post['recommended']==1?"checked":""; $recommended_no=$post['recommended']==0?"checked":""; ?>
			<label class="radio"><input type="radio" name="post[post_status]" value="1" <?php echo ($status_yes); ?>><span>审核通过</span></label>
			<label class="radio"><input type="radio" name="post[post_status]" value="0" <?php echo ($status_no); ?>><span>未审核</span></label>
		 	</span>
		 </td>
        </tr>
        <tr>
          <td>
          	<span class="switch_list cc">
			<label class="radio"><input type="radio" name="post[istop]" value="1" <?php echo ($istop_yes); ?>><span>置顶</span></label>
			<label class="radio"><input type="radio" name="post[istop]" value="0" <?php echo ($istop_no); ?>><span>未置顶</span></label>
		 	</span>
		 </td>
        </tr>
        <tr>
          <td>
          	<span class="switch_list cc">
			<label class="radio"><input type="radio" name="post[recommended]" value="1" <?php echo ($recommended_yes); ?>><span>推荐</span></label>
			<label class="radio"><input type="radio" name="post[recommended]" value="0" <?php echo ($recommended_no); ?>><span>未推荐</span></label>
		 	</span>
		 </td>
        </tr>
      </table>
    </div>
  </div> -->
  <div class="col-auto">
    <div class="table_full">
      <table class="table table-bordered">
          <!--   <tr>
              <th width="80">栏目</th>
              <td>
				<select multiple="multiple" style="max-height: 100px;" name="term[]">
					<?php echo ($taxonomys); ?>
				</select>
				<div>
					windows：按住 Ctrl 按钮来选择多个选项,Mac：按住 command 按钮来选择多个选项
				</div>
              </td>
            </tr> -->
            <tr>
              <th width="80">景区名称</th>
              <td>
              	<input type="hidden" id="post_id" value="<?php echo ($post["id"]); ?>">
                <input type="hidden" id="admin_id" value="<?php echo (session('ADMIN_ID')); ?>">
              	<?php echo ($post["post_title"]); ?>
              </td>
            </tr>
            <tr>
             <th width="80">时间</th>
          <td><?php echo ($post["post_date"]); ?></td>
        </tr>
            <tr>
              <th width="80">省份</th>
              <td><?php echo ($post["post_province"]); ?></td>
            </tr>
            <tr>
              <th width="80">城市</th>
              <td><?php echo ($post["post_city"]); ?></td>
            </tr>
             <tr>
              <th width="80">地址</th>
              <td><?php echo ($post["post_venue"]); ?></td>
            </tr>

            <tr>
              <th width="80">选择票价类型</th>
              <td>
              	  <input name="price" type="radio" data-value="1" value="<?php echo ($post["adult_price"]); ?>" checked/>成人票<span>(<?php echo ($post["adult_price"]); ?>¥)&nbsp;&nbsp;   
                  <input name="price" type="radio" data-value="2"  value="<?php echo ($post["children_price"]); ?>" />儿童老人票(<?php echo ($post["children_price"]); ?>¥)&nbsp;&nbsp; 
                  <input name="price" type="radio" data-value="3" value="<?php echo ($post["student_price"]); ?>" />学生票(<?php echo ($post["student_price"]); ?>¥)&nbsp;&nbsp; 
                  <input name="price" type="radio" data-value="4" value="<?php echo ($post["soldier_price"]); ?>" />军人票(<?php echo ($post["soldier_price"]); ?>¥)&nbsp;&nbsp;
                  <input name="price" type="radio" data-value="5" value="<?php echo ($post["disabled_price"]); ?>" />残疾人票(<?php echo ($post["disabled_price"]); ?>¥)&nbsp;&nbsp;
              </td>
            </tr>

            <tr>
              <th width="80">应付金额:</th>
              <td id="price"><?php echo ($post["adult_price"]); ?>¥</td>
            </tr>
            <!-- <tr>
              <th width="80">关键词</th>
              <td><input type='text' name='post[post_keywords]' id='keywords' style='width:400px' value="<?php echo ($post['post_keywords']); ?>"  class='input' placeholder='请输入关键字'> 多关键词之间用空格或者英文逗号隔开</td>
            </tr>
            
            <tr>
              <th width="80">文章来源</th>
              <td><input type='text' name='post[post_source]' id='source' value="<?php echo ($post['post_source']); ?>" style='width:400px'   class='input' placeholder='请输入文章来源'></td>
            </tr>
            <tr>
              <th width="80">摘要 </th>
              <td><textarea name='post[post_excerpt]' id='description' required style='width:98%;height:50px;'  placeholder='请填写摘要'><?php echo ($post["post_excerpt"]); ?></textarea><span class="must_red">*</span></td>
            </tr>
            <tr>
              <th width="80">内容</th>
              <td><div id='content_tip'></div>
              	<script type="text/plain" id="content" name="post[post_content]"><?php echo ($post["post_content"]); ?></script>
                <script type="text/javascript">
                //编辑器路径定义
                var editorURL = GV.DIMAUB;
                </script>
                <script type="text/javascript"  src="/statics/js/ueditor/ueditor.config.js"></script>
                <script type="text/javascript"  src="/statics/js/ueditor/ueditor.all.min.js"></script>
				</td>
            </tr>
            <tr>
              <th width="80">相册图集 </th>
              <td>
				<fieldset class="blue pad-10">
		        <legend>图片列表</legend>
		        <ul id="photos" class="picList unstyled">
			        <?php if(is_array($smeta['photo'])): foreach($smeta['photo'] as $key=>$vo): ?><li id="savedimage<?php echo ($key); ?>">
				        	<input type="text" name="photos_url[]" value="<?php echo sp_get_asset_upload_path($vo['url']);?>" title='双击查看' style="width:310px;" ondblclick="image_priview(this.value);" class="input">
				        	<input type="text" name="photos_alt[]" value="<?php echo ($vo["alt"]); ?>" style="width:160px;" class="input" onfocus="if(this.value == this.defaultValue) this.value = ''" onblur="if(this.value.replace(' ','') == '') this.value = this.defaultValue;">
				        	<a href="javascript:remove_div('savedimage<?php echo ($key); ?>')">移除</a>
				        </li><?php endforeach; endif; ?>
		        </ul>
				</fieldset>
				<a href="javascript:;" style="margin: 5px 0;" onclick="javascript:flashupload('albums_images', '图片上传','photos',change_images,'10,gif|jpg|jpeg|png|bmp,0','','','')" class="btn">选择图片 </a>
			  </td>
            </tr> -->
                        
        </tbody>
      </table>
    </div>
  </div>
  <div class="form-actions">
        <button class="btn btn-primary btn_submit J_ajax_submit_btn" onclick="printPage()">打印</button>
        <a class="btn" href="<?php echo U('AdminPost/index');?>">返回</a>
  </div>
</div>
<script type="text/javascript" src="/statics/js/common.js"></script>
<script type="text/javascript" src="/statics/js/content_addtop.js"></script>
<script type="text/javascript"> 
//单选框改变时间
$(":radio").click(function(){
   var price = $(this).val();
   $("#price").text(price+"¥");
});

function printPage(){
    //掉
    //window.print()
    addPrintOrder();
}
//打印完成以后添加打印订单
function addPrintOrder(){
    var post_id      = $("#post_id").val();
    var admin_id     = $("#admin_id").val();
    var ticket_price = $('input:radio:checked').val();
    var ticket_type  = $('input:radio:checked').attr('data-value');
     
    $.post("<?php echo U('AdminPost/addOrder');?>",{post_id:post_id,admin_id:admin_id,ticket_type:ticket_type,ticket_price,ticket_price},function(data){
          if(data.status == 1 ){
              alert('打印成功！');
          }else{
              alert('打印失败！');
          }
    })
}

</script>
</body>
</html>